﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="cn_member_center_user_info" Codebehind="user_info.aspx.cs" %>
             
<%@ Register Src="../UserControl/header.ascx" TagName="header" TagPrefix="uc1" %>
<%@ Register Src="../UserControl/top_ad.ascx" TagName="top_ad" TagPrefix="uc2" %>
<%@ Register Src="../UserControl/member_menu.ascx" TagName="member_menu" TagPrefix="uc3" %>
<%@ Register Src="../UserControl/footer.ascx" TagName="footer" TagPrefix="uc4" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>会员信息，<%=(new Gift.WebApp.BasicSet()).TitleBind() %></title>
    <meta name="Keywords" content="<%=(new Gift.WebApp.BasicSet()).KeywordBind() %>" />
    <meta name="Description" content="<%=(new Gift.WebApp.BasicSet()).DescriptionBind() %>" />
    <link href="/script/css/public.css" type="text/css" rel="stylesheet" />
    <link href="/script/css/member.css" type="text/css" rel="stylesheet" />
    <link href="/script/css/ie.css" type="text/css" rel="stylesheet" />

    <script language="Javascript" type="text/javascript" src="/script/js/jquery-1.6.2.min.js"></script>

    <!--登陆注册 弹出窗口-->
    <style type="text/css" media="all">
        @import "/js/login/thickbox.css";
    </style>

    <script src="/script/js/login/thickbox.js" type="text/javascript"></script>
    
     <link href="/script/art_dialog/skins/idialog.css" rel="stylesheet" />

    <script type="text/javascript" src="/script/art_dialog/artDialog.js"></script>

    <script type="text/javascript" src="/script/art_dialog/plugins/iframeTools.source.js"></script>

    <script type="text/javascript" src="/script/js/art_dialog.js"></script>

    <script type="text/javascript">
        $(function () {
            $("#btnUserInfoSubmit").click(function () {
                if ($("#txtEmail").val() == "") {
                    $("#txtEmail").select();
                    $("#spEmail").html("<img src=\"/script/images/wrong.gif\" />请输入电子邮箱！");
                    return false;
                } else {
                    if ($("#txtEmail").val().match(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == null) {
                        $("#txtEmail").select();
                        $("#spEmail").html("<img src=\"/script/images/wrong.gif\" />电子邮箱格式不符！");
                        return false;
                    } else $("#spEmail").html("<img src=\"/script/images/right.gif\"/>");
                }
                if ($("input[name='sex']:checked").val() == null) {
                    $("#radSex1").select();
                    $("#spSex").html("<img src=\"/script/images/wrong.gif\" />请选择性别！");
                    return false;
                } else $("#spSex").html("<img src=\"/script/images/right.gif\"/>");
                if ($("#txtTelephone").val() == "" && $("#txtMobile").val() == "") {
                    $("#txtTelephone").select();
                    $("#spMobile").html("<img src=\"/script/images/wrong.gif\" />联系电话和手机号码至少填写一项！");
                    return false;
                } else $("#spMobile").html("");
                if ($("#txtTelephone").val() != "") {
                    if ($("#txtTelephone").val().match(/^(([0\+]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/) == null) {
                        $("#txtTelephone").select();
                        $("#spTelephone").html("<img src=\"/script/images/wrong.gif\" />联系电话格式不符！");
                        return false;
                    } else $("#spTelephone").html("<img src=\"/script/images/right.gif\"/>");
                } else $("#spTelephone").html("");
                if ($("#txtMobile").val() != "") {
                    if (/^13\d{9}$/g.test($("#txtMobile").val()) || (/^15[0-35-9]\d{8}$/g.test($("#txtMobile").val())) || (/^18[05-9]\d{8}$/g.test($("#txtMobile").val()))) {
                        $("#spMobile").html("<img src=\"/script/images/right.gif\"/>");
                    } else {
                        $("#txtMobile").select();
                        $("#spMobile").html("<img src=\"/script/images/wrong.gif\" />手机号码格式不符！");
                        return false;
                    }
                } else $("#spMobile").html("");
                if ($("#txtFax").val() != "") {
                    if ($("#txtFax").val().match(/^(([0\+]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/) == null) {
                        $("#txtFax").select();
                        $("#spFax").html("<img src=\"/script/images/wrong.gif\" />传真格式不符！");
                        return false;
                    } else $("#spFax").html("<img src=\"/script/images/right.gif\"/>");
                } else $("#spFax").html("");
                $.ajax({
                    type: "POST",
                    url: "user_info.ashx",
                    data: "email=" + $("#txtEmail").val() + "&nickName=" + escape($("#txtNickName").val()) + "&sex=" + $("input[name='sex']:checked").val() + "&telephone=" + $("#txtTelephone").val() + "&mobile=" + $("#txtMobile").val() + "&fax=" + $("#txtFax").val() + "&address=" + $("#txtAddress").val() + "&qq=" + $("#txtQQ").val() + "&msn=" + $("#txtMSN").val() + "&wangwang=" + $("#txtWangwang").val(),
                    success: function (msg) {
                        if (msg == "0") {
                            art.dialog.tips("恭喜您，更新成功！", 1.5);
                            setTimeout("window.location.reload()", 2000);
                        }
                        else if (msg == "1") art.dialog.tips("很抱歉，更新失败！", 1.5);
                    }
                });
                return false;
            });
        });
    </script>

</head>
<body onload="javascript:$('#txtEmail').select();">
    <uc1:header ID="Header1" runat="server" />
    <uc2:top_ad ID="Top_ad1" runat="server" />